count = 0
last = 0
a = 1
b = 100
guess = -1
import random

number = random.randint(1, 101)
while guess != number:
    guess = int(input("请猜一个%d-%d的整数：" % (a, b)))
    guess != last
    count = count + 1
    last = guess
    if guess < number:
        a = guess
        print("您猜的数小了")
    if guess > number:
        b = guess
        print("您猜的数大了")
    if guess == number:
        print("您猜对了，总共猜了%d次" % count)
